<:Title>
  Todos

<:Body>
  <h1>Todos Example</h1>

  <div id="count">{{ completed }} of {{ _todos.size }}</div>

  <table id="todos-table" class="table">
    {{ _todos.each_with_index do |todo, idx| }}
      <tr>
        <td>{{ idx+1 }}.</td>
        <td><input type="checkbox" checked="{{ todo._completed }}"></td>
        <td class="name {{ if todo._completed }}complete{{ end }}">{{todo._name}}</td>
        <td>{{ todo._created_at.time_distance_in_words }}</td>
        <td><button e-click="remove_todo(todo)">X</button></td>
      </tr>
    {{ end }}
  </table>

  <form e-submit="add_todo" role="form">
    <div class="form-group">
       <label>Todo</label>
       <input class="form-control" id="newtodo" type="text" value="{{ page._new_todo }}" />

    </div>
  </form>
